package net.zjitc.stack;

import java.util.LinkedList;
import java.util.List;

public class MyLinkedStack <E> implements MyStack<E> {
    private LinkedList list = new LinkedList();
    @Override
    public void push(E e) {
      list.addLast(e);
    }

    @Override
    public E pop() {
        return (E)list.removeLast();
    }

    @Override
    public E peek() {
        return (E) list.getLast();
    }

    @Override
    public boolean isEmpty() {
        return list.isEmpty();
    }

}
